<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Login</title>
    </h:head>
    <h:body>
        <h:form id="f1">
            <h:panelGrid border="1" frame="box" style="margin-left: 45%;">
            <f:facet name="header">
                <h:outputText value="Hệ thống đăng nhập"/>
            </f:facet>
            <h:panelGroup>
                <h:outputText value="Tài khoản"/>
                <p:inputText id="txtUserName" value="#{users.newUser.username}" required="true" requiredMessage="Xin vui lòng cung cấp tên đăng nhập"/>
                <p:message for="txtUserName" showDetail="true"/>
            </h:panelGroup>
            <h:panelGroup>
                <h:outputText value="Mật khẩu"/>
                <p:inputText  id="txtPassword" value="#{users.newUser.password}" required="true" requiredMessage="Xin vui lòng cung cấp mật khẩu"/>
                <p:message for="txtPassword" showDetail="true"/>
            </h:panelGroup>
            <f:facet name="footer">
                <h:panelGroup style="float: right">
                    <p:commandButton action="#{users.validateUser()}" value="Đăng nhập" ajax="true"/>
                    <p:commandButton value="Hủy" ajax="true" action="/FlyMyWay/newjsf.xhtml" immediate="true"/>
                </h:panelGroup>
            </f:facet>
        </h:panelGrid>
        </h:form>
    </h:body>
</html>

